

import os
import pytest
import requests

#登录接口
@pytest.fixture(scope='session',autouse=True)
def getlogin():
    url=os.getenv('base_url')+os.getenv('login_url')
    body={
        "email":"1478997572@qq.com",
        "pwd":"eWLPHopE945d2ivttHaQTQ=="
    }
    res=requests.post(url,data=body).json()
    print("正常返回",res)
    return res['result']['sessionId'],res['result']['userId']
#我的电影票
# def getid():
#     data=getlogin()
#     headers = {
#         "userId": str(data[1]),
#         "sessionId": data[0]
#     }
#     return headers